1. Field of the Invention
The present invention relates to a recording apparatus, a recording medium, a recording method, and a related computer program, the recording apparatus writing secure data such as encryption keys, rights management information, and billing information into an SD memory card or similar recording medium.
2. Related Art
A secure digital (SD) memory card is a recording medium used to record contents, secure data, and the like distributed by a contents distribution service. Not only that, but the SD memory card can store distributed secure data with a high level of confidentiality, and for this reason SD memory cards are quickly gaining the confidence of contents distribution service providers. The structure of the SD memory card capable of providing this high level of confidentiality is described as follows. An SD memory card includes (i) a user data area in which content is recorded in encrypted form, and (ii) a protected area in which secure data corresponding to the content is recorded. The user data area can be freely accessed by an apparatus to which the SD memory card is connected. In contrast, the protected area can only be accessed if there is mutual authentication between the SD memory card and the apparatus. Thus, an apparatus provided with a license by the contents distribution service provider to manage the distributed contents will be able to clear the mutual authentication process, while access by an unauthorized apparatus will be denied at the mutual authentication stage. In this way the confidentiality of secure data is maintained.
While mutual authentication is required to access the protected area, the protected area is managed using a file system, like any of the other areas on a semiconductor memory card. According to a conventional file allocation table (FAT) file system, a single file is managed in a unit known as a “cluster”. Secure data, although highly confidential, tends to be of small 16-byte or 64-byte size, which is less than one-hundredth the size of a single cluster. Because of this large difference in size, storage space is very inefficiently used when one piece of secure data is stored in a single file.
This problem can be overcome by storing plural pieces of secure data together in a single file. However, the storage of plural pieces of secure data in single file eventually results in the problem of “fragmentation” (i.e. unused areas lying scattered between used areas).
When an SD memory card is used over a long period of time to record distributed contents, a large amount of secure data accumulates on the SD memory card. The number of files on the SD memory card can be increased to meet storage needs. On the other hand, secure data is deleted when corresponding content becomes obsolete. Since the storage space of an SD memory card is often limited, secure data corresponding to new content should preferably be recorded in an unused area arising from a deletion. However, because unused areas become scattered throughout a plurality of files when plural pieces of secure data are stored in a single file, a search is required to determine which files have unused areas available to write secure data. In addition, mutual authentication is required between the SD memory card and the apparatus in order to access a file in the protected area, and this mutual authentication process becomes an overhead that extends the time required to complete a file access. Since this overhead is incurred in opening each file, much time is wasted searching for a file having an unused area, and as a result a long period of time is required to complete the writing of data.